.class public Les/x8;
.super Les/u8;
.source "MosaicFilter.java"


# static fields
.field public static final p:Ljava/lang/String;


# instance fields
.field private i:I

.field private j:I

.field private k:F

.field private l:F

.field private m:J

.field private n:J

.field private o:Z


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .line 1
    invoke-static {}, Lcom/esfile/screen/recorder/media/d;->a()Landroid/content/Context;

    move-result-object v0

    sget v1, Lcom/esfile/screen/recorder/media/e;->hexagon_mosaic_frag:I

    .line 2
    invoke-static {v0, v1}, Les/x8;->a(Landroid/content/Context;I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Les/x8;->p:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(J)V
    .locals 3

    .line 1
    sget-object v0, Les/x8;->p:Ljava/lang/String;

    const-string v1, "uniform mat4 uMVPMatrix;\nuniform mat4 uSTMatrix;\nattribute vec4 aPosition;\nattribute vec4 aTextureCoord;\nvarying vec2 vTextureCoord;\nvoid main() {\n  gl_Position = uMVPMatrix * aPosition;\n  vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n}\n"

    invoke-direct {p0, v1, v0}, Les/u8;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    const-wide/16 v0, 0x0

    cmp-long v2, p1, v0

    if-gtz v2, :cond_0

    const-wide/32 p1, 0x1e8480

    .line 2
    :cond_0
    iput-wide p1, p0, Les/x8;->m:J

    return-void
.end method

.method private static a(Landroid/content/Context;I)Ljava/lang/String;
    .locals 3

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v1, 0x0

    .line 2
    :try_start_0
    new-instance v2, Ljava/io/InputStreamReader;

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p0

    invoke-virtual {p0, p1}, Landroid/content/res/Resources;->openRawResource(I)Ljava/io/InputStream;

    move-result-object p0

    invoke-direct {v2, p0}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

    .line 3
    new-instance p0, Ljava/io/BufferedReader;

    invoke-direct {p0, v2}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 4
    :goto_0
    :try_start_1
    invoke-virtual {p0}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object p1

    if-eqz p1, :cond_0

    .line 5
    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const/16 p1, 0xa

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_3
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 6
    :cond_0
    :try_start_2
    invoke-virtual {p0}, Ljava/io/BufferedReader;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_1

    :catch_0
    move-exception p0

    .line 7
    invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V

    .line 8
    :goto_1
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    return-object p0

    :catchall_0
    move-exception p1

    move-object v1, p0

    goto :goto_2

    :catchall_1
    move-exception p1

    :goto_2
    if-eqz v1, :cond_1

    .line 9
    :try_start_3
    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_3

    :catch_1
    move-exception p0

    .line 10
    invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V

    .line 11
    :cond_1
    :goto_3
    throw p1

    :catch_2
    move-object p0, v1

    :catch_3
    if-eqz p0, :cond_2

    .line 12
    :try_start_4
    invoke-virtual {p0}, Ljava/io/BufferedReader;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_4

    goto :goto_4

    :catch_4
    move-exception p0

    .line 13
    invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V

    :cond_2
    :goto_4
    return-object v1
.end method

.method private c(J)V
    .locals 2

    .line 7
    iget-wide v0, p0, Les/x8;->n:J

    sub-long/2addr p1, v0

    long-to-float p1, p1

    iget-wide v0, p0, Les/x8;->m:J

    long-to-float p2, v0

    div-float/2addr p1, p2

    const/high16 p2, 0x3f800000    # 1.0f

    mul-float p1, p1, p2

    iput p1, p0, Les/x8;->k:F

    .line 8
    invoke-static {p2, p1}, Ljava/lang/Math;->min(FF)F

    move-result p1

    const/4 v0, 0x0

    invoke-static {v0, p1}, Ljava/lang/Math;->max(FF)F

    move-result p1

    iput p1, p0, Les/x8;->k:F

    sub-float/2addr p2, p1

    .line 9
    iput p2, p0, Les/x8;->k:F

    return-void
.end method

.method private d(J)V
    .locals 2

    .line 1
    iget-wide v0, p0, Les/x8;->n:J

    sub-long/2addr p1, v0

    long-to-float p1, p1

    iget-wide v0, p0, Les/x8;->m:J

    long-to-float p2, v0

    div-float/2addr p1, p2

    const p2, 0x3da3d70a    # 0.08f

    mul-float p1, p1, p2

    const v0, 0x38d1b717    # 1.0E-4f

    add-float/2addr p1, v0

    iput p1, p0, Les/x8;->l:F

    .line 2
    invoke-static {p2, p1}, Ljava/lang/Math;->min(FF)F

    move-result p1

    invoke-static {v0, p1}, Ljava/lang/Math;->max(FF)F

    move-result p1

    iput p1, p0, Les/x8;->l:F

    return-void
.end method


# virtual methods
.method public a()I
    .locals 1

    const/16 v0, 0xde1

    return v0
.end method

.method protected b(J)V
    .locals 1

    .line 1
    iget-boolean v0, p0, Les/x8;->o:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Les/x8;->o:Z

    .line 3
    iput-wide p1, p0, Les/x8;->n:J

    .line 4
    :cond_0
    invoke-direct {p0, p1, p2}, Les/x8;->c(J)V

    .line 5
    invoke-direct {p0, p1, p2}, Les/x8;->d(J)V

    .line 6
    iget p1, p0, Les/x8;->j:I

    iget p2, p0, Les/x8;->l:F

    invoke-static {p1, p2}, Landroid/opengl/GLES20;->glUniform1f(IF)V

    const-string p1, "glUniform1f"

    .line 7
    invoke-static {p1}, Lcom/esfile/screen/recorder/media/glutils/b;->a(Ljava/lang/String;)V

    .line 8
    iget p2, p0, Les/x8;->i:I

    iget v0, p0, Les/x8;->k:F

    invoke-static {p2, v0}, Landroid/opengl/GLES20;->glUniform1f(IF)V

    .line 9
    invoke-static {p1}, Lcom/esfile/screen/recorder/media/glutils/b;->a(Ljava/lang/String;)V

    return-void
.end method

.method protected c()V
    .locals 2

    .line 1
    iget v0, p0, Les/u8;->a:I

    const-string v1, "len"

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result v0

    iput v0, p0, Les/x8;->j:I

    const-string v0, "glGetUniformLocation len"

    .line 2
    invoke-static {v0}, Lcom/esfile/screen/recorder/media/glutils/b;->a(Ljava/lang/String;)V

    .line 3
    iget v0, p0, Les/x8;->j:I

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/glutils/b;->a(ILjava/lang/String;)V

    .line 4
    iget v0, p0, Les/u8;->a:I

    const-string v1, "s_alpha"

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result v0

    iput v0, p0, Les/x8;->i:I

    const-string v0, "glGetUniformLocation s_alpha"

    .line 5
    invoke-static {v0}, Lcom/esfile/screen/recorder/media/glutils/b;->a(Ljava/lang/String;)V

    .line 6
    iget v0, p0, Les/x8;->i:I

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/glutils/b;->a(ILjava/lang/String;)V

    return-void
.end method
